package cn.njxzc.exercises;

class A2

{

	int x, y, z, sum;

	A2(int i, int j, int k)

	{

		x = i;

		y = j;

		z = k;

		sum = x + y + z;

	}

	boolean sameA(A2 a1)

	{

		if ((a1.x == x) & (a1.y == y) & (a1.z == z))

			return true;

		else

			return false;

	}

	boolean sameS(A2 a1)

	{

		if (a1.sum == sum)

			return true;

		else

			return false;

	}

}

class Exer3_1

{

	public static void main(String[] args)

	{

		A2 a = new A2(2, 5, 8);

		A2 b = new A2(2, 5, 8);

		A2 c = new A2(5, 8, 2);

		System.out.println(a.sameA(b));

		System.out.println(a.sameA(c));

		System.out.println(a.sameS(b));

		System.out.println(a.sameS(c));

	}

}
